#include <iostream>

using namespace std;
/**
 * c++ 函数参数是值传递，复制
 */

void swap(int &a, int &b){
    int tmp = a;
    a = b;
    b = tmp;
    b= 100;
    cout<<"in swap function:"<< a<<","<<b<<endl;
}

int main()
{
    int a = 1;
    int b = 2;
    swap(a, b);
    cout<<"in main function:"<<endl;
    cout<< a << endl ;
    cout<< b << endl ;
}
